package cn.iocoder.yudao.module.api.shop.revenue.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 分佣记录状态
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/01/09
 */
@RequiredArgsConstructor
@Getter
public enum RevenueStatusEnum implements EnumValuable {
    FREEZING(0, "待入账"),
    UNFREEZE(1, "已结算"),
    CLOSED(2, "已失效"),
    CANCEL(3, "已取消"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    public static RevenueStatusEnum valueOf(Integer value) {
        for (RevenueStatusEnum item : values()) {
            if (item.value.equals(value)) {
                return item;
            }
        }
        return FREEZING;
    }

}
